<script setup>
import { formatPrice } from '../../utils/format';
import { routerTo } from '../../utils/common';

//查看商品详情
const handleDetails=()=>{
	routerTo("/pages/shop/details")
}
</script>


<template>
  <view class="card-goods"  @tap="handleDetails">
     <view class="img"><image class="image" src="/static/tmp_goods.jpg" mode="aspectFill"></image></view>
	 <view class="title">
		 <text>瓶酒</text>
	 </view>
	 <view class="price">
		 <view class="new"><view class="icon">￥</view>{{formatPrice(6666)}}</view>
		 <view class="old">￥{{formatPrice(25601)}}</view>
	 </view>
  </view>
</template>


<style lang="scss" scoped>
.card-goods{
	.img{
		.image{
			border-radius: 10rpx;
			width: 328rpx;
			height: 328rpx;
		}
	}
	.title{
		font-size: 32rpx;
		font-weight: bold;
		padding: 10rpx 0;
		@include text-ellipsis(1);
	}
	.price{
		display: flex;
		align-items: flex-end;
		gap: 10rpx;
		.new{
			display: flex;
			align-items: flex-end;
			font-size: 32rpx;
			font-weight: bolder;
			color:$uni-color-warning;
			.icon{
				font-size: 24rpx;
	
			}
		}
		.old{
			font-size: 20rpx;
			color:#ccc;
			text-decoration: line-through;
		}
	}
}


</style>